import fetch from 'common/src/utils/fetch';

/*
*分页教务员查询强化班录取信息
*/
export function queryScStudentAdmissionResultList(template) {
  return fetch({
    url: '/api/cultureservice/ScAdmStuRel/queryScStudentAdmissionResultList',
    method: 'post',
    data: template
  })
}

/**
 * 学院教务员导出强化班学生名单
 * @param {Object} params
 */
export function exportExcelScStudentInfoByCollege(params) {
  const url = '/api/cultureservice/ScAdmStuRel/exportExcelScStudentInfoByCollege';
  let queryParam = ''
  for (const key in params) {
    // 去掉空参数
    if (
      key === 'pageNum_' ||
      key === 'pageSize_' ||
      key === 'total_' ||
      params[key] === ''
    ) {
      continue
    }
    queryParam += `${key}=${params[key]}&`
  }
  window.open(`${url}?${queryParam}`)
}

/**
 * 查询当前院系教务员所属院系
 */
export function getDepartmentIdByScCollege() {
  return fetch({
    url: '/api/cultureservice/ScAdmStuRel/getDepartmentIdByScCollege',
    method: 'get'
  })
}


/**
 * 下拉返回所有专业
 */
export function findDeptForClassroom() {
  return fetch({
    url: '/api/userservice/dept/findDeptForClassroom',
    method: 'post',
    data: {"isCourse":1}
  })
}